Skip to content

Conversation

@patinkaew
Copy link
Contributor

PR description:

Please also note contributions from @gpetruc, @Mmiglio for initial and important components of L1ScoutingNano as well as L1Scouting team for numerous valuable feedbacks.

This PR introduces L1ScoutingNanoAOD workflow for Run3. For L1Scouting data, each processing event is actually an orbit (in OrbitCollection), different OutputModule is needed to convert orbits to bunch crossings (bx).

Some key features:

  • OrbitNanoAODOutputModule is analogous to NanoAODOutputModule and is used to convert orbits to bxs.
  • OrbitFlatTable is analogous to nanoaod::FlatTable and contains offsets of each bx in an orbit
  • SimpleOrbitFlatTableProducer is analogous to SimpleFlatTableProducer and has all functionalities of SimpleFlatTableProducer.

Two custom NanoAOD flavours are added: @L1Scout for ZeroBias stream and @L1ScoutSelect for Selection stream.

Event content files (html) can be found here on CERNBOX.

PR validation:

Pass all tests from scram b runtests use-ibeos.

Two relval_nano workflows are added for each flavour.
Pass these two workflows from runTheMatrix.py -l 2500.240,2500.241

If this PR is a backport please specify the original PR and why you need to backport that PR. If this PR will be backported please specify to which release cycle the backport is meant for:

This is not a backport.

@cmsbuild
Copy link
Contributor

cmsbuild commented May 23, 2025

cms-bot internal usage

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48163/44934

@ftorrresd
Copy link
Contributor

enable nano

@ftorrresd
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

-1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-43d56f/46799/summary.html
COMMIT: fe95b32
CMSSW: CMSSW_15_1_X_2025-06-16-2300/el8_amd64_gcc12
Additional Tests: NANO
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/48163/46799/install.sh to create a dev area with all the needed externals and cmssw changes.

This pull request cannot be automatically merged, could you please rebase it?
You can see the log for git cms-merge-topic here: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-43d56f/46799/git-merge-result

@patinkaew
Copy link
Contributor Author

Hi @ftorrresd,

Sorry for a delay. I just fix the merge conflict.

Please note that the workflow numbers for L1ScoutingNano have changed (since BPHNano workflow in 140X was removed in master).

2500.239 L1Scouting2024RAW14.0+l1ScoutingNANO_data14.0 
2500.24 L1ScoutingSelection2024RAW14.0+l1ScoutingSelectionNANO_data14.0

Best,
Patin

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-48163/45278

@cmsbuild
Copy link
Contributor

+1

Size: This PR adds an extra 24KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-43d56f/47469/summary.html
COMMIT: 7fa4b88
CMSSW: CMSSW_15_1_X_2025-07-30-2300/el8_amd64_gcc12
Additional Tests: NANO
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/48163/47469/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially removed 1 lines from the logs
  • Reco comparison results: 8 differences found in the comparisons
  • DQMHistoTests: Total files compared: 50
  • DQMHistoTests: Total histograms compared: 4076122
  • DQMHistoTests: Total failures: 61
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 4076041
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 49 files compared)
  • Checked 215 log files, 184 edm output root files, 50 DQM output files
  • TriggerResults: no differences found

NANO Comparison Summary

Summary:

  • You potentially removed 194 lines from the logs
  • ROOTFileChecks: Some differences in event products or their sizes found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 22
  • DQMHistoTests: Total histograms compared: 89100
  • DQMHistoTests: Total failures: 0
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 89100
  • DQMHistoTests: Total skipped: 0
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 21 files compared)
  • Checked 134 log files, 80 edm output root files, 22 DQM output files
  • TriggerResults: no differences found

Nano size comparison Summary:

  • Nano ERROR: Missing ref/2500.2309_L1ScoutingNANOdata140Xrun3-size.json
  • Nano ERROR: Missing ref/2500.2309_L1ScoutingNANOdata140Xrun3-size.json
  • Nano ERROR: Missing ref/2500.231_L1ScoutingSelectionNANOdata140Xrun3-size.json
  • Nano ERROR: Missing ref/2500.231_L1ScoutingSelectionNANOdata140Xrun3-size.json
workflow id kb/ev ref kb/ev diff kb/ev ev/s/thd ref ev/s/thd diff rate mem/thd ref mem/thd
NANOmc106Xul16v2 2500.0001 3.118 3.118 0.000 ( +0.0% ) 3.70 3.42 +8.3% 2.604 2.790
NANOmc106Xul17v2 2500.0002 3.177 3.177 0.000 ( +0.0% ) 3.44 3.21 +7.2% 2.632 3.281
NANOmc106Xul18v2 2500.0003 3.128 3.128 0.000 ( +0.0% ) 3.49 3.24 +8.0% 2.615 3.261
NANOdata106Xul16v2 2500.0101 1.560 1.560 0.000 ( +0.0% ) 5.97 5.62 +6.3% 2.351 2.855
NANOdata106Xul17v2 2500.0102 1.948 1.948 0.000 ( +0.0% ) 4.04 3.77 +7.3% 2.381 3.029
NANOdata106Xul18v2 2500.0103 1.914 1.914 0.000 ( +0.0% ) 4.83 4.55 +6.3% 2.411 3.004
NANOmcUL16APVreMINI 2500.0201 0.022 0.022 0.000 ( +0.0% ) 1.66 1.78 -6.6% 2.607 2.996
NANOmcUL16reMINI 2500.0202 0.022 0.022 0.000 ( +0.0% ) 1.59 1.62 -2.4% 2.595 2.978
NANOmcUL17reMINI 2500.0203 0.022 0.022 0.000 ( +0.0% ) 1.52 1.55 -1.7% 2.557 2.695
NANOmcUL18reMINI 2500.0204 0.022 0.022 0.000 ( +0.0% ) 1.29 1.35 -4.5% 2.760 3.130
NANOdataUL16APVreMINI 2500.0301 0.035 0.035 0.000 ( +0.0% ) 1.29 1.39 -7.0% 2.677 2.926
NANOdataUL16reMINI 2500.0302 0.036 0.036 0.000 ( +0.0% ) 1.46 1.52 -3.6% 2.624 2.941
NANOdataUL17reMINI 2500.0303 0.037 0.037 0.000 ( +0.0% ) 1.24 1.33 -7.0% 2.716 2.956
NANOdataUL18reMINI 2500.0304 0.036 0.036 0.000 ( +0.0% ) 1.27 1.34 -5.2% 2.701 2.933
NANOmc130X 2500.1001 3.220 3.220 0.000 ( +0.0% ) 4.24 3.89 +9.2% 2.454 3.232
NANOdata130Xrun3 2500.1101 1.799 1.799 0.000 ( +0.0% ) 6.22 5.80 +7.4% 2.637 2.823
ScoutingNANOdata130Xrun3 2500.1301 0.771 0.771 0.000 ( +0.0% ) 32.83 33.38 -1.7% 1.683 1.696
muPOGNANOmc140X 2500.2201 2.065 2.065 0.000 ( +0.0% ) 5.31 5.56 -4.5% 2.179 2.356
EGMNANOmc140X 2500.2202 3.876 3.876 0.000 ( +0.0% ) 3.82 4.00 -4.4% 2.473 2.726
BTVNANOmc140X 2500.2203 10.607 10.607 0.000 ( +0.0% ) 2.43 2.45 -0.6% 2.641 2.934
jmeNANOmc140X 2500.2204 6.666 6.666 0.000 ( +0.0% ) 1.11 1.10 +1.1% 2.543 2.715
lepTrackInfoNANOmc140X 2500.2206 3.570 3.570 0.000 ( +0.0% ) 3.83 4.00 -4.3% 2.448 2.717
ScoutingNANOmc140X 2500.2207 1.486 1.486 0.000 ( +0.0% ) 15.18 15.10 +0.5% 1.965 2.024
ScoutingNANOwithPromptmc140X 2500.2208 4.474 4.474 0.000 ( +0.0% ) 3.26 3.05 +7.0% 2.770 2.935
muPOGNANO140Xrun3 2500.2301 1.469 1.469 0.000 ( +0.0% ) 7.32 7.58 -3.5% 2.410 2.676
EGMNANOdata140Xrun3 2500.2302 2.623 2.623 0.000 ( +0.0% ) 5.50 5.38 +2.3% 2.740 3.021
BTVNANOdata140Xrun3 2500.2303 5.612 5.612 0.000 ( +0.0% ) 3.50 3.42 +2.4% 2.881 2.860
jmeNANOdata140Xrun3 2500.2304 3.976 3.976 0.000 ( +0.0% ) 1.41 1.34 +5.6% 2.754 2.713
lepTrackInfoNANOdata140Xrun3 2500.2306 2.413 2.413 0.000 ( +0.0% ) 5.48 5.33 +2.9% 2.707 2.652
ScoutingNANOdata140Xrun3 2500.2307 1.101 1.101 0.000 ( +0.0% ) 28.58 27.66 +3.3% 1.507 1.633
ScoutingNANOwithPromptdata140Xrun3 2500.2308 2.783 2.783 0.000 ( +0.0% ) 4.93 4.52 +9.1% 2.933 3.150
l1DPGNANO140Xrun3 2500.2401 9.404 9.404 0.000 ( +0.0% ) 7.17 6.49 +10.4% 1.834 1.935
muDPGNANO140Xrun3 2500.2402 10.331 10.331 0.000 ( +0.0% ) 1.65 1.58 +4.8% 1.681 1.735
muDPGNANOBkg140Xrun3 2500.2403 2.712 2.712 0.000 ( +0.0% ) 15.69 14.98 +4.8% 1.065 1.066
hcalDPGNANO140Xrun3 2500.2404 486.016 486.016 0.000 ( +0.0% ) 1.13 1.10 +3.3% 1.621 1.737
hcalDPGCalibNANO140Xrun3 2500.2405 826.413 826.413 0.000 ( +0.0% ) 1.52 1.46 +3.9% 1.639 1.707
hcalDPGMCNANO140Xrun3 2500.2501 645.333 645.333 0.000 ( +0.0% ) 1.65 1.60 +3.5% 1.705 1.814
NANOmc2024reMINI 2500.2601 0.021 0.021 0.000 ( +0.0% ) 1.45 1.42 +1.8% 2.824 3.155
NANOdata2024reMINI 2500.2701 0.036 0.036 0.000 ( +0.0% ) 1.26 1.26 +0.0% 2.662 2.927
NANOmc150X 2500.3001 3.217 3.217 0.000 ( +0.0% ) 17.28 14.69 +17.7% 2.676 2.770
NANOdata150X 2500.3101 2.144 2.144 0.000 ( +0.0% ) 33.08 28.42 +16.4% 2.247 2.494
NANOdata150X 2500.3102 2.630 2.630 0.000 ( +0.0% ) 22.93 18.00 +27.4% 2.328 2.570
muPOGNANOmc150X 2500.3201 2.255 2.255 0.000 ( +0.0% ) 14.50 11.34 +27.8% 2.394 2.643
EGMNANOmc150X 2500.3202 4.111 4.111 0.000 ( +0.0% ) 13.47 10.82 +24.5% 2.464 2.751
BTVNANOmc150X 2500.3203 10.552 10.552 0.000 ( +0.0% ) 4.60 4.07 +12.9% 2.736 2.972
jmeNANOmc150X 2500.3204 6.760 6.760 0.000 ( +0.0% ) 1.30 1.18 +9.6% 2.649 2.351
jmeNANOrePuppimc150X 2500.3205 6.763 6.763 0.000 ( +0.0% ) 1.24 1.13 +9.5% 3.180 2.608
lepTrackInfoNANOmc150X 2500.3206 3.721 3.721 0.000 ( +0.0% ) 14.24 12.27 +16.1% 2.510 2.738
ScoutingNANOmc150X 2500.3207 1.562 1.562 0.000 ( +0.0% ) 18.72 16.79 +11.5% 2.447 2.551
ScoutingNANOwithPromptmc150X 2500.3208 4.774 4.774 0.000 ( +0.0% ) 10.34 9.83 +5.1% 2.802 2.985
BPHNANOmc150X 2500.3209 4.109 4.109 0.000 ( +0.0% ) 16.33 15.32 +6.6% 2.610 2.813
muPOGNANO150Xrun3 2500.3301 1.125 1.125 0.000 ( +0.0% ) 23.20 21.19 +9.5% 2.108 2.402
EGMNANOdata150Xrun3 2500.3302 2.985 2.985 0.000 ( +0.0% ) 20.92 18.68 +12.0% 2.185 2.495
BTVNANOdata150Xrun3 2500.3303 7.971 7.971 0.000 ( +0.0% ) 5.64 4.87 +15.7% 2.363 2.705
jmeNANOdata150Xrun3 2500.3304 4.349 4.349 0.000 ( +0.0% ) 1.58 1.47 +7.8% 2.357 2.649
jmeNANOrePuppidata150Xrun3 2500.3305 4.332 4.332 0.000 ( +0.0% ) 1.38 1.32 +5.1% 2.613 2.926
lepTrackInfoNANOdata150Xrun3 2500.3306 2.625 2.625 0.000 ( +0.0% ) 22.84 18.25 +25.1% 2.158 2.488
ScoutingNANOdata150Xrun3 2500.3307 1.737 1.737 0.000 ( +0.0% ) 30.16 28.14 +7.2% 1.513 1.694
ScoutingNANOwithPromptdata150Xrun3 2500.3308 2.601 2.601 0.000 ( +0.0% ) 17.09 16.47 +3.8% 2.525 2.799
BPHNANOdata150Xrun3 2500.3309 2.604 2.604 0.000 ( +0.0% ) 32.76 31.27 +4.8% 2.366 2.536
TTbarMINIAOD10.6_UL18v2 2500.9001 1.819 1.819 0.000 ( +0.0% ) 28.67 27.60 +3.9% 1.838 1.939
TTbarMINIAOD14.0 2500.9002 1.665 1.665 0.000 ( +0.0% ) 27.54 27.74 -0.7% 1.551 1.579
DYToLL_M-50_13TeV_pythia8 2500.9101 14.345 14.345 0.000 ( +0.0% ) 7.62 7.37 +3.4% 1.101 1.097
DYToll01234Jets_5f_LO_MLM_Madgraph_LHE_13TeV 2500.9102 0.437 0.240 0.197 ( +81.9% ) 2.94 2.92 +0.6% 0.851 0.853
TTbar_Pow_LHE_13TeV 2500.9103 0.110 0.110 0.000 ( +0.0% ) 2.49 2.43 +2.7% 0.855 0.853

@tj710
Copy link

tj710 commented Aug 4, 2025

Hi @AdrianoDee, @Moanwar, @cmsbuild, @DickyChant, @emeschi, @ftorrresd, @hqucms, @miquork, @smorovic, @srimanob, @subirsarkar

Are you able to review and/or sign please?

Thanks a lot!

Thomas

@ftorrresd
Copy link
Contributor

+1

@Moanwar
Copy link
Contributor

Moanwar commented Aug 4, 2025

+Upgrade

@emeschi
Copy link
Contributor

emeschi commented Aug 5, 2025

+1

@AdrianoDee
Copy link
Contributor

+pdmv

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @mandrenguyen, @rappoccio, @antoniovilela, @sextonkennedy (and backports should be raised in the release meeting by the corresponding L2)

@mandrenguyen
Copy link
Contributor

+1


#include "oneapi/tbb/task_arena.h"

class OrbitNanoAODOutputModule : public edm::one::OutputModule<> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't realize this part until it broke compilation against ROOT master (see #48720 for a fix).

I'm curious what is the planned maintenance model wrt. NanoAODOutputModule given that some amount of non-trivial code is currently "shared" by copying it (i.e. any similarity can be thought of accidental). Are there parts that should be really shared, or is the future of these two components completely disjoint?

Also, who will port/migrate this module to RNTuple in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Matti,

Sorry for a delayed response. We discussed this a bit during last week L1 Scouting meeting 19.08.2025.

Thank you for the fix and sorry that I didn't catch the deprecated constants earlier. Since OrbitNanoAODOutputModule shares lots of code with NanoAODOutputModule, it would be optimally not to hard-copy to avoid code duplication and if there is a change in NanoAODOutputModule, OrbitNanoAODOutputModule will be changed accordingly (for example, in this case). Hence, the current implementation is not quite optimal and leaves this issue on deprecated constants unchecked. However, I would expect that NanoAODOutputModule will need to be refactored and personally, I wouldn't want to do this during data-taking so I hope the refactor will be done after Run3 finishes.

OrbitNanoAODOutputModule handles translating from orbit-based collection used in L1 scouting to event-based. From my understanding, CMSSW processes event-by-event. In the L1 scouting case, this is orbit-by-orbit. Hence, we use OutputModule to handle changing to event-based when writing to TTree. Do you have any suggestions/ideas on how we can use the standard NanoAODOutputModule?

Regarding porting this module to RNTuple, I'm not very familiar with RNTuple nor RNTupleOutputModule yet and not following the latest development, but I would be happy to implement it if I'm still working with CMS (hopefully). Otherwise, I will compile some documentation for the L1Scouting group so someone will be able to take over as well.

@gpetruc also agrees with this and suggested that we refactor and migrate to RNTuple at the same time. He can also offer to help.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, I would expect that NanoAODOutputModule will need to be refactored and personally, I wouldn't want to do this during data-taking so I hope the refactor will be done after Run3 finishes.

Ok.

Do you have any suggestions/ideas on how we can use the standard NanoAODOutputModule?

No. I'd look into abstracting the common parts into components that could be shared between this and the NanoAODOutputModule.

Regarding porting this module to RNTuple, I'm not very familiar with RNTuple nor RNTupleOutputModule yet and not following the latest development, but I would be happy to implement it if I'm still working with CMS (hopefully). Otherwise, I will compile some documentation for the L1Scouting group so someone will be able to take over as well.

Ok. The RNTuple-based NanoAOD is still in the works (@ariostas), so it might be useful to either wait for that dust to settle, have this use case included in that work. In any case all this is eventually up to @cms-sw/xpog-l2 (and possibly @cms-sw/daq-l2). I only got concerned of somewhat complicated code being copied around, and if that would have potential to cause maintenance issues in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants